<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>

<body>
    <div id="app">
        <book v-for="item in bookList" :name="item.name" :author="item.author"></book>
    </div>
    <script>
        Vue.component("book", {
            props: ["name", "author"],
            template: `
            <div>
                <p>书名：{{name}}</p>
                <p>作者：{{author}}</p>
            </div>           
           `
        })
        var app = new Vue({
            el:"#app",
            data:{
                bookList:[
                {
                    name:"西游记",
                    author:"吴承恩"
                },
                {
                    name:"水浒传",
                    author:"施耐庵"
                },
                {
                    name:"红楼梦",
                    author:"曹雪芹"
                },
                {
                    name:"三国演义",
                    author:"罗贯中"
                }
            ]
            }
        })

    </script>
</body>

</html>